home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / A-Monthly Disks / (c)aai.d64 / war rescue (.txt) < prev   
Commodore BASIC  |  2007-02-04  |  7KB  |  240 lines

  1. 100 REM ***************************
  2. 110 REM *       WAR RESCUE        *
  3. 120 REM *                         *
  4. 130 REM *    HOWARD CAMPBELL      *
  5. 132 REM *    3463 PIPER DRIVE     *
  6. 134 REM *    NORTHWOOD, OHIO      *
  7. 136 REM *    43619                *
  8. 140 REM ***************************
  9. 150 :
  10. 160 :
  11. 170 :
  12. 180 REM //////////////////
  13. 190 REM / INITIALIZATION /
  14. 200 REM //////////////////
  15. 210 :
  16. 220 POKE53281,14:POKE53280,14:POKE646,0
  17. 230 PRINT"[147]"SPC(15)"WAR RESCUE":PRINTSPC(52)"BY HOWARD CAMPBELL"
  18. 240 POKE53270,PEEK(53270)AND247
  19. 250 PRINT"  WAIT A MOMENT...."
  20. 260 PRINT""SPC(7)"PLACE JOYSTICK IN PORT 2"
  21. 270 V=53248  : REM V=VICII STARTING ADDRESS
  22. 280 S=54272 : REM S=SID STARTING ADDRESS
  23. 290 FORI=STOS+24:POKEI,0:NEXT : REM CLEAR SID
  24. 300 FORI=1009TO1012:READA:POKEI,A:NEXT: REM SPRITE TABLE
  25. 310 DATA192,193,194,195
  26. 320 HM$=CHR$(19)
  27. 330 CR$=CHR$(13):LF$="":FORI=1TO24:LF$=LF$+CR$:NEXTI
  28. 340 CK=0:TK=CK:FORI=0TO383:READA:POKEI+12288,AAND255
  29. 350 POKE53280,CK:TK=TK+A:CK=CK+1
  30. 360 IFCK=8THENGOSUB2400
  31. 370 NEXTI
  32. 380 CK=0:TK=CK:FORI=828TO853+6:READA:POKEI,AAND255
  33. 390 POKE53280,CK:TK=TK+A:CK=CK+1
  34. 400 IFCK=8THENGOSUB2400
  35. 410 NEXTI
  36. 420 CK=0:TK=CK:FORI=49152TO49408+7:READA:POKEI,AAND255
  37. 430 POKE53280,CK:TK=TK+A:CK=CK+1
  38. 440 IFCK=8THENGOSUB2400
  39. 450 NEXTI
  40. 460 POKE1008,230:POKE1007,65:POKE1006,0
  41. 470 POKES+1,8 : POKES+6,240 : POKES+24,15 : REM CHOPPER SOUND
  42. 480 POKES+12,160:POKES+13,252:POKES+8,1:POKES+7,40: REM EXPLOSION
  43. 490 POKEV+39,10 : REM SET SPRITE 0 COLOR
  44. 500 POKEV+40,0 : REM SET SPRITE 1 COLOR
  45. 510 POKEV+37,1  : REM MULTI-COLOR 1
  46. 520 POKEV+38,0  : REM MULTI-COLOR 2
  47. 530 POKEV+29,1 : REM EXPAND SPRITE 0 IN X DIRECTION
  48. 540 POKEV+27,1 : REM SPRITE PRIORITY
  49. 550 POKEV+28,1 : REM SET SPRITE 0 TO MULTI-COLOR
  50. 560 POKEV+1,65  : POKEV,255 : POKEV+16,0: REM SET SPRITE 0 POSITIONS
  51. 570 POKEV+2,255 : POKEV+3,214 : REM SET SPRITE 1 POSITIONS
  52. 580 POKE2041,197 : REM POINT SPRITE 1 DATA POINTER
  53. 590 POKE53281,9:PRINTCHR$(147);:POKE53281,14:POKE53280,9 : REM FILL COLOR SCREEN
  54. 600 FORI=1984TO2023:POKEI,160:NEXTI
  55. 610 FT=0:FL=0
  56. 620 A=PEEK(V+31) : REM CLEAR SPR/CHR COLLISION REGISTER
  57. 630 A=PEEK(V+30) : REM CLEAR SPR/SPR COLLISION REGISTER
  58. 640 POKEV+21,3 : REM TURN ON SPRITES
  59. 650 SYS 828 : REM START IRQ WEDGE
  60. 660 A=0
  61. 670 :
  62. 680 REM ////////////////
  63. 690 REM / MAIN ROUTINE /
  64. 700 REM ////////////////
  65. 710 :
  66. 720 POKES+4,129:POKE2041,197:POKEV+3,225
  67. 730 IFRND(.)<.05THENGOSUB920
  68. 740 POKES+4,128:POKE56333,127
  69. 750 ONAGOSUB880,890,900
  70. 760 A=INT(RND(.)*10+1):POKE56333,129
  71. 770 POKE1184+40*INT(RND(.)*15),42
  72. 780 POKES+11,129:POKES+4,129
  73. 790 POKE2041,196:POKEV+3,223
  74. 800 POKE1007,PEEK(1007)+1
  75. 810 FT=FT+1:PRINTHM$;"[144] FEET:"FT;TAB(20)"FUEL:    [157][157][157][157]"200-PEEK(1007)"[149]"
  76. 820 POKES+4,128:POKES+11,128
  77. 830 C1=PEEK(V+31)AND1:IFC1<>.THENGOSUB990:GOSUB1290:GOTO460
  78. 840 C2=PEEK(V+30):IFC2<>.THENGOSUB1150
  79. 850 GOTO720
  80. 860 END
  81. 870 :
  82. 880 PRINTLEFT$(LF$,20)"[149][169]  [223]"CR$"    "CR$" [166]  "CR$"[149] ":A=10:RETURN
  83. 890 PRINTLEFT$(LF$,21)"[153]#":PRINT"[149][194]":PRINT" ":RETURN
  84. 900 PRINTLEFT$(LF$,20)"[153]   /"CR$"[153][185]  [146][185]"CR$"[155][215][215][215][215]"CR$"[149] ":A=10:RETURN
  85. 910 :
  86. 920 Y=RND(.)*200+50:SE=10:IFPEEK(V+2)>YTHENSE=-10
  87. 930 FORI=PEEK(V+2)TOYSTEPSE:POKEV+2,I:POKE2041,197:POKE2041,196:NEXTI:RETURN
  88. 940 :
  89. 950 REM /////////////////////
  90. 960 REM / SPR/CHR COLLISION /
  91. 970 REM /////////////////////
  92. 980 :
  93. 990 POKE2040,1
  94. 1000 POKEV+21,1
  95. 1010 POKES+11,128:POKES+11,17
  96. 1020 POKE2040,194 : A=255
  97. 1030 FORI=PEEK(V+1)TO236:POKEV+1,I:POKES+8,A:A=A-1:NEXTI
  98. 1040 SYS 841
  99. 1050 POKE2040,10
  100. 1060 POKES+4,128:POKES+11,16:POKES+8,1
  101. 1070 POKES+11,129
  102. 1080 FORI=1TO10STEP.5:POKE2040,I:NEXT:POKES+11,128
  103. 1090 RETURN
  104. 1100 :
  105. 1110 REM /////////////////////
  106. 1120 REM / SPR/SPR COLLISION /
  107. 1130 REM /////////////////////
  108. 1140 :
  109. 1150 POKE1007,60:POKEV+3,PEEK(V+1)-3
  110. 1160 POKES+1,200:POKES,255:POKES+4,33
  111. 1170 FORJ=200TO255STEP5:POKES+1,J:NEXTJ
  112. 1180 POKEV+21,1
  113. 1190 C2=PEEK(V+30)
  114. 1200 POKES+1,8:POKES+4,32:POKES,0
  115. 1210 POKEV+1,65:POKEV+2,RND(.)*200+50
  116. 1220 POKEV+21,3
  117. 1230 RETURN
  118. 1240 :
  119. 1250 REM /////////
  120. 1260 REM / RESET /
  121. 1270 REM /////////
  122. 1280 :
  123. 1290 FORI=1024TO1263:POKEI,32:NEXTI
  124. 1300 PRINT"DISTANCE TRAVELED:"FT"FEET"
  125. 1310 IFFT>MXTHENMX=FT
  126. 1320 POKE53270,PEEK(53270)OR8
  127. 1330 PRINT"RECORD DISTANCE  :"MX"FEET"
  128. 1340 PRINT"[144]WOULD YOU LIKE TO TRY AGAIN?"
  129. 1350 PRINT"PRESS THE FIRE BUTTON TO CONTINUE"
  130. 1360 PRINT"PRESS ANY KEY TO QUIT"
  131. 1370 A=PEEK(56320)AND16
  132. 1380 GETA$:IFA$<>""THENEND
  133. 1390 IFA<>.THEN1370
  134. 1400 POKE53270,PEEK(53270)AND247
  135. 1410 RETURN
  136. 1420 :
  137. 1430 REM ///////////////
  138. 1440 REM / SPRITE DATA /
  139. 1450 REM ///////////////
  140. 1460 :
  141. 1470 :
  142. 1480 DATA000,000,000,000,000,000,000,000,000
  143. 1490 DATA000,085,085,064,000,192,000,002,428
  144. 1500 DATA224,000,015,252,006,031,247,011,786
  145. 1510 DATA095,245,253,095,245,255,095,247,1530
  146. 1520 DATA000,255,252,000,003,000,000,195,705
  147. 1530 DATA000,000,063,252,000,000,000,000,315
  148. 1540 DATA000,000,000,000,000,000,000,000,000
  149. 1550 DATA000,000,000,000,000,000,000,000,000
  150. 1560 :
  151. 1570 DATA000,000,000,000,000,000,000,000,000
  152. 1580 DATA000,000,064,000,000,192,000,000,256
  153. 1590 DATA192,000,015,252,001,031,247,003,741
  154. 1600 DATA095,245,247,095,245,255,095,247,1524
  155. 1610 DATA000,255,252,000,003,000,000,195,705
  156. 1620 DATA000,000,063,252,000,000,000,000,315
  157. 1630 DATA000,000,000,000,000,000,000,000,000
  158. 1640 DATA000,000,000,000,000,000,000,000,000
  159. 1650 :
  160. 1660 DATA000,000,000,000,000,000,000,000,000
  161. 1670 DATA000,085,085,064,000,192,000,000,426
  162. 1680 DATA192,000,015,252,004,031,247,003,744
  163. 1690 DATA095,245,253,095,245,255,095,247,1530
  164. 1700 DATA000,255,252,000,003,000,000,195,705
  165. 1710 DATA000,000,063,252,000,000,000,000,315
  166. 1720 DATA000,000,000,000,000,000,000,000,000
  167. 1730 DATA000,000,000,000,000,000,000,000,000
  168. 1740 :
  169. 1750 DATA000,000,000,000,000,000,000,000,000
  170. 1760 DATA000,000,064,000,000,192,000,002,258
  171. 1770 DATA224,000,015,252,002,031,247,011,782
  172. 1780 DATA095,245,247,095,245,255,095,247,1524
  173. 1790 DATA000,255,252,000,003,000,000,195,705
  174. 1800 DATA000,000,063,252,000,000,000,000,315
  175. 1810 DATA000,000,000,000,000,000,000,000,000
  176. 1820 DATA000,000,000,000,000,000,000,000,000
  177. 1830 :
  178. 1840 DATA000,000,000,000,000,000,000,000,000
  179. 1850 DATA000,000,000,000,000,000,000,000,000
  180. 1860 DATA000,000,000,000,000,000,000,000,000
  181. 1870 DATA000,096,000,000,096,000,000,016,208
  182. 1880 DATA000,000,024,000,000,052,000,000,076
  183. 1890 DATA088,000,000,144,000,000,040,000,272
  184. 1900 DATA000,072,000,000,140,000,001,132,345
  185. 1910 DATA000,000,000,000,000,000,000,000,000
  186. 1920 :
  187. 1930 DATA000,000,000,000,000,000,000,000,000
  188. 1940 DATA000,000,000,000,000,000,000,000,000
  189. 1950 DATA000,000,000,000,000,000,000,000,000
  190. 1960 DATA000,048,000,000,048,000,000,016,112
  191. 1970 DATA000,000,024,000,000,176,000,000,200
  192. 1980 DATA112,000,000,016,000,000,016,000,144
  193. 1990 DATA000,016,000,000,016,000,000,016,048
  194. 2000 DATA000,000,048,000,000,000,000,000,048
  195. 2010 :
  196. 2020 DATA120,169,0,141,20,3,169,192,814,141
  197. 2030 DATA21,3,88,96,120,169,49,687,141,20,3
  198. 2040 DATA169,234,141,21,3,732,88,96,0,0,0,0,0,0,184
  199. 2050 :
  200. 2060 DATA173,0,220,74,176,3,206,1,853,208,74
  201. 2070 DATA176,3,238,1,208,74,982,176,42,173
  202. 2080 DATA0,208,208,31,173,1011,16,208,41,1,208
  203. 2090 DATA16,173,16,679,208,9,1,141,16,208,169
  204. 2100 DATA80,832,141,0,208,76,106,192,173,16,912
  205. 2110 DATA208,41,252,141,16,208,206,0,1072,208
  206. 2120 DATA76,106,192,74,176,32,238,1102,0,208
  207. 2130 DATA240,30,169,80,205,0,932,208,208,20
  208. 2140 DATA173,16,208,41,1,875,240,13,173,16
  209. 2150 DATA208,41,252,141,1084,16,208,169,0,141
  210. 2160 DATA0,208,76,818,106,192,173,16,208,9
  211. 2170 DATA1,141,846,16,208,173,238,3,24,105
  212. 2180 DATA1,768,201,4,208,2,169,0,141,238,963,3
  213. 2190 DATA170,189,241,3,141,248,7,1002,224,2
  214. 2200 DATA208,10,169,129,141,4,887,212,169,128
  215. 2210 DATA141,4,212,173,239,1278,3,205,1,208
  216. 2220 DATA144,3,141,1,706,208,173,237,3,24,105
  217. 2230 DATA1,41,792,3,141,237,3,201,0,240,3,828,76
  218. 2240 DATA49,234,169,40,133,253,169,1123,4,133
  219. 2250 DATA254,169,40,133,251,169,1153,216,133
  220. 2260 DATA252,32,231,192,165,253,1474,24,105
  221. 2270 DATA40,133,253,165,254,105,1079,0,133,254
  222. 2280 DATA165,251,24,105,40,972,133,251,165
  223. 2290 DATA252,105,0,133,252,1291,165,253,201
  224. 2300 DATA192,208,221,165,254,1659,201,7,208
  225. 2310 DATA215,76,49,234,160,1150,38,177,253,200
  226. 2320 DATA145,253,136,177,1379,251,200,145,251
  227. 2330 DATA136,136,192,255,1566,208,239,160,0
  228. 2340 DATA169,32,145,253,1206,96,0,0,0,0,0,0,0,96
  229. 2350 :
  230. 2360 REM ////////////////
  231. 2370 REM / DATA CHECKER /
  232. 2380 REM ////////////////
  233. 2390 :
  234. 2400 READA:IFTK=ATHENCK=0:TK=CK:RETURN
  235. 2410 POKE53270,PEEK(53270)OR8
  236. 2420 LN=PEEK(63)+PEEK(64)*256
  237. 2430 PRINT"[147]DATA ERROR IN LINE #";LN
  238. 2440 PRINT"CHECK DATA ON THIS LINE OR LINE #"LN-10
  239. 2450 END
  240.